﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using Emoney.DataAccess;
using LiuYan.Base;
using LiuYan.Entity;


namespace LiuYan.Service
{
   public class ReplyService
    {
       /// <summary>
       /// edit attention reply message
       /// </summary>
       /// <param name="entity"></param>
       /// <returns></returns>
       public int Edit(TB_Reply entity)
       {
         SqlParameter parameter=new SqlParameter("@text",SqlDbType.VarChar,500);
           parameter.Value = entity.Content;
           string sql = "update [dbo].[TB_Reply] set [Content]=@text";
           return SqlHelper.ExecuteNonQuery(Connection.conStr, CommandType.Text, sql, parameter);
       }

       /// <summary>
       /// get this fist reply data 
       /// </summary>
       /// <returns></returns>
       public DataTable GetData()
       {
           string sql = "select top(1)* from TB_Reply";
           return SqlHelper.ExecuteDataset(Connection.conStr, CommandType.Text, sql).Tables[0];
       }

    }
}
